package controller.manufacture;

import java.sql.SQLException;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import controller.material.Material;
import controller.material.NewCropSlio;
import controller.material.RostingBeansSlio;
import controller.packaging.BottlePackage;
import controller.packaging.BoxPackage;

import service.CoffeeService;

@Controller
public class ThreadManage {
	private CoffeeService service;
	public ThreadManage(CoffeeService service) {
		this.service = service;
	}
	
	@RequestMapping("MainThread.do")
	public void AllStartThread(){
		Roster ros = new Roster(service);
		Material mtr = new Material(service);
		NewCropSlio ncs = new NewCropSlio(service);
		Pressure psu = new Pressure(service);
		Grinder gri = new Grinder(service);
		RostingBeansSlio rbs = new RostingBeansSlio(service);
		MixingMachine mm = new MixingMachine(service);
		BottlePackage bp = new BottlePackage(service);
		BoxPackage bxp = new BoxPackage(service);
		
//		try {
//			service.updateMachineWaitingJob("글라인더", 2);
//		} catch (SQLException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}
		rbs.start();
//		gri.start();
//		ncs.start();
//		ros.start();
//		mtr.start();
//		psu.start();
//		mm.start();
//		bp.start();
//		bxp.start();
		
	}
}
